#include "ScriptedPch.h"

bool ItemClick_item_tele(Player* pl, Item* item)
{
    if(pl->isInCombat())
        return false;

    pl->ADD_GOSSIP_ITEM(0, "Show me my teleportation options.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
    pl->SEND_GOSSIP_MENU(112233 /*TODO*/, item->GetGUID());

    return true;

}

bool GossipSelect_item_tele(Player* pl, Creature* creature , uint32 uiSender, uint32 uiAction)
{
    if(!uiSender)
        return false;

    switch(uiAction)
    {
        case GOSSIP_ACTION_INFO_DEF+1:
            pl->ADD_GOSSIP_ITEM(0, "IT WORKED THROUGH GOSSIPSELECT", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
            pl->SEND_GOSSIP_MENU(112233 /*TODO*/, creature->GetGUID());
            return true;

        default:
            return true;
    }

    return true;
}

void AddSC_item_tele()
{
    Script *newscript;
    newscript = new Script;
    newscript->Name="item_tele";
    newscript->pOnItemClick = &ItemClick_item_tele;
    newscript->pGossipSelect = &GossipSelect_item_tele;
    newscript->RegisterSelf();
}
